#!/usr/bin/env python

from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine

from app.core.base_class import MyBase

from app.core.model.dw_meta_model import TbFile 
from app.core.model.dw_meta_model import TbFldLenNew

class DwsdataManager(MyBase):

    def __init__(self):
        MyBase.__init__(self)

        self.debug('DwsdataManager init begin')
        self.engine = create_engine('mysql://root:123456@192.168.56.1/dwsdata?charset=utf8')
        Session = sessionmaker(bind=self.engine)
        self.session = Session()
        self.debug('DwsdataManager init complemented.')
    
    def get_session(self):
        return self.session

    def get_connection(self):
        return self.engine.connect()

if __name__ == '__main__':
    dsm = DwsdataManager()
